<?php $url_room_add = $this->url(array('module'=>'room','controller'=>'index','action'=>'add'));
$url_room = $this->url(array('module'=>'index','controller'=>'dashboad','action'=>'index'));
$url_rooms = $this->url(array('module'=>'foundation','controller'=>'index','action'=>'index'));
$tr = Application_Form_FrmLanguages::getCurrentlanguage();
$session_user=new Zend_Session_Namespace('auth');
$request=Zend_Controller_Front::getInstance()->getRequest();
$user_info = new Application_Model_DbTable_DbGetUserInfo();
$result = $user_info->getUserInfo();
?>
<form action="<?php echo $url_room_add;?>" method="post" id="frm">
    <div id="wrapper">
      <div id="page-wrapper">

        <div class="row"  style=" width:100%; margin:0 auto" >
          <div class="col-lg-12">
            <h2 style="color:#00F">Create room</h2>
          </div>
        </div><!-- /.row -->

        <div class="row">
        <div class="panel-heading">    	  
        
          <button name="save_new" value="save_new" class="btn btn-small btn-primary">
			<b><i class="fa fa-plus"></i></b> &nbsp;Save New 
		  </button>
		  <button name="save_colse" value="save_colse" class="btn btn-small btn-primary">
		  <b><i class="icon-check"></i></b> &nbsp;Save Colse	
		  </button>
		  <?php if($session_user->user_id==1||2||3){?>
		  <a href="<?php echo $url_room;?>">
		  <button type="button" name="cancel" value="cancel" class="btn btn-small btn-warning">
			  <b><i class="fa fa-times"></i></b> &nbsp;Cancel					 
		  </button>
		  </a>
		  <?php }else{ ?>
		  <a href="<?php echo $url_rooms;?>">
		  <button type="button" name="cancel" value="cancel" class="btn btn-small btn-warning">
			  <b><i class="fa fa-times"></i></b> &nbsp;Cancel					 
		  </button>
		  </a>
		  <?php }?>
        </div>
        <table border="0" cellpadding="5" width="50%" style="margin:0 auto;">
        	<tr>
            	<td>Name Floor:</td>
                <td> <?php echo $this->fromroom->getElement("floor_id");?></td>
            </tr>
            <tr>
            	<td>Room Name:</td>
                <td> <?php echo $this->fromroom->getElement("room_name");?></td>
            </tr>
            <tr>
            	<td>Room Size:</td>
                <td> <?php echo $this->fromroom->getElement("room_size");?></td>
            </tr>
            <tr>
            	<td>Ordering:</td>
                <td> <?php echo $this->fromroom->getElement("ordering");?></td>
            </tr>
            <tr>
            	<td>Description :</td>
                <td> <?php echo $this->fromroom->getElement("description");?></td>
            </tr>
        </table>      
        </div><!-- /#page-row -->
      </div><!-- /#page-wrapper -->

    </div><!-- /#wrapper -->   
</form>
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
   <div class="modal-dialog">
        <div class="modal-content">
             <div class="modal-header">
              <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
              <table border="0" cellpadding="5" width="50%" style="margin:0 auto;">
			   	<tr>
			       	<td>Name Floor:</td>
			        <td> <?php echo $this->formfloors->getElement("floor_name");?></td>
			    </tr>
			  </table> 
			 <div class="panel-body" style="text-align: center;">	  
				<button name="save_colse" value="save_colse" class="btn btn-small btn-primary" onclick="addfloor()">
				<b><i class="icon-check"></i></b> &nbsp;Save Colse	
				</button>
				<a href="<?php echo $url_room_add;?>">
				<button type="button" name="cancel" value="cancel" class="btn btn-small btn-warning">
				<b><i class="fa fa-times"></i></b> &nbsp;Cancel					 
				</button>
				</a>
			  </div>     
      </div>
      <!-- /.modal-content -->
   </div>
<!-- /.modal-dialog -->
</div>
</div>
<script type="text/javascript">
// function ShowPopupProduct(){
// 	floor_ids = $("#floor_id").val();
// 	if(floor_ids==-1){
// 		$("#floor_id").attr({
// 			'data-toggle': "modal",
// 			'data-target': "#myModal"
// 		});      
// 	}
// }
<?php // $url_add_new =  $this->url(array('module'=>'room','controller'=>'index','action'=>'addfloor')); ?>
// function addfloor(){
// 	alert("OK");
// 	var floorname = $("#floor_name").val();
// 	validate_text('#floor_name');
// 		$.ajax({
	        url: "<?php echo $url_add_new;?>",
// 	        type: "post",
// 	        data: {'pro_name':pro_name,'pro_code':pro_code,'category_id':category_id,'brand_id':brand_id,'remark':remark},
// 	        success: function(data){
// 	           val = $.parseJSON(data);
// 	           $('#item_id_'+record_id).append($('<option></option>').attr('value',val['pid']).attr("selected",true).text(pro_name)); 
// 	           $('#item_id_'+record_id).trigger("liszt:updated");
// 	            document.getElementById("frm1").reset();
// 	            HideDialog();
// 	        },
// 	        error:function(){
// 	            $("#result").html('There is error while submit');
// 	        }
// 	    });	
// }

</script>